Apparatus and method for compensating for heading angle

ABSTRACT

Disclosed herein are an apparatus and method for compensating for a heading angle. The apparatus for compensating for a heading angle includes a compensation condition determination unit configured to determine whether a predetermined compensation condition is satisfied, to compensate for a heading angle of a camera, and a heading angle processing unit configured to compensate for the heading angle of the camera using a lane distance input from the camera, when it is determined by the compensation condition determination unit that the compensation condition is satisfied.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a Continuation Application of U.S. patentapplication Ser. No. 16/503,151, filed on Jul. 3, 2019, which claims thebenefit under 35 USC § 119(a) Korean Patent Application No.10-2018-0078679 filed on Jul. 6, 2018, in the Korean IntellectualProperty Office, the entire disclosures of which are incorporated hereinby reference for all purposes.

BACKGROUND 1. Technical Field

Embodiments of the present disclosure relate to an apparatus and methodfor compensating for a heading angle, and more particularly, to anapparatus and method for compensating for a heading angle, which assistlane keeping of a vehicle by compensating for a heading angle of acamera through a lane distance.

2. Related Art

With the development of driving assistance system (DAS) and the demandfor autonomous driving in recent years, autonomous steering control oractive steering control that automatically operates an electric steeringsystem regardless of the intention of the driver has been developed, inaddition to a basic function that assists the steering force of thedriver.

Depending on such autonomous steering control or active steeringcontrol, there are a variety of steering-related control systems thataffect an electric steering system for vehicles.

Examples of the steering-related control system for vehicles include alane keeping assistance system (LKAS) that controls a vehicle to travelin a fixed lane after detecting the lane and controls lane keeping byoperating a steering system, regardless of driver's operation, whenthere is concern about a lane departure.

The lane keeping assistance system detects a lane and detects thedriving state of a vehicle to compensate for a heading angle or warn ofa lane departure so that the vehicle is not out of the detected lane.

A conventional lane keeping assistance system recognizes lanes byanalyzing images acquired through a camera. Especially, the controlperformance of the lane keeping assistance system for performing lateralcontrol using the camera is significantly affected by the lane signalaccuracy of the camera. The system is problematic in that it controlsthe vehicle to be one-sided from the center of the lane when an erroroccurs in the camera calibration that affects the accuracy.

The foregoing is disclosed in Korean Patent Application Publication No.10-2018-0015018 (Feb. 12, 2018), entitled “Method of Estimating LaneInformation”.

SUMMARY

Various embodiments are directed to an apparatus and method forcompensating for a heading angle, capable of assisting lane keeping of avehicle by compensating for a heading angle of a camera through a lanedistance.

In an embodiment, there is provided an apparatus for compensating for aheading angle, which includes a compensation condition determinationunit configured to determine whether a predetermined compensationcondition is satisfied, to compensate for a heading angle of a camera,and a heading angle processing unit configured to compensate for theheading angle of the camera using a lane distance input from the camerawhen it is determined by the compensation condition determination unitthat the compensation condition is satisfied.

The compensation condition determination unit may determine whether avehicle travels straight ahead.

The compensation condition determination unit may determine whether thevehicle travels straight ahead, using at least one of a vehicle yawrate, a vehicle speed, a lane curvature, a camera viewing area, a camerareliability, a lane type, and a lane width variation.

The compensation condition determination unit may determine whether thevehicle travels straight ahead, using a steering angle of the vehicle.

The compensation condition determination unit may detect a trajectory ofthe vehicle using a GPS signal and map information and determine whetherthe vehicle travels straight ahead, using the detected trajectory.

The compensation condition determination unit may determine whether alane is a straight lane.

The compensation condition determination unit may determine whether thelane is the straight lane, using a curvature of the lane and a headingangle of the camera.

The heading angle processing unit may include a heading angle offsetprocessing unit configured to detect a heading angle offset using theheading angle of the camera and the lane distance therefrom, and aheading angle compensating unit configured to compensate for the headingangle of the camera by subtracting the heading angle offset, detected bythe heading angle offset processing unit, from the heading angle of thecamera.

The heading angle offset processing unit may include a reference headingangle calculator configured to calculate a reference heading angle fromthe heading angle of the camera using the lane distance, a differencevalue detector configured to detect difference values between thereference heading angle calculated by the reference heading anglecalculator and the heading angle of the camera in chronological order,and a heading angle offset detector configured to detect the headingangle offset by averaging the difference values, detected by thedifference value detector, for each time zone.

In an embodiment, there is provided an apparatus for compensating for aheading angle, which includes a heading angle offset processing unitconfigured to detect a heading angle offset using a heading angle of acamera and a lane distance therefrom, and a heading angle compensatingunit configured to compensate for the heading angle of the camera usingthe heading angle of the camera and the heading angle offset detected bythe heading angle offset processing unit.

The heading angle compensating unit may compensate for the heading angleof the camera by subtracting the heading angle offset, detected by theheading angle offset processing unit, from the heading angle of thecamera.

The heading angle offset processing unit may include a reference headingangle calculator configured to calculate a reference heading angle usingthe lane distance, a difference value detector configured to detectdifference values between the reference heading angle calculated by thereference heading angle calculator and the heading angle of the camerain chronological order, and a heading angle offset detector configuredto detect the heading angle offset by averaging the difference values,detected by the difference value detector, for each time zone.

In an embodiment, there is provided a method of compensating for aheading angle, which includes determining whether a predeterminedcompensation condition is satisfied, to compensate for a heading angleof a camera, by a compensation condition determination unit, andcompensating for the heading angle of the camera using a lane distanceinput from the camera, when it is determined by the compensationcondition determination unit that the compensation condition issatisfied, by a heading angle processing unit.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may determinewhether a vehicle travels straight ahead.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may determinewhether the vehicle travels straight ahead, using at least one of avehicle yaw rate, a vehicle speed, a lane curvature, a camera viewingarea, a camera reliability, a lane type, and a lane width variation.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may determinewhether the vehicle travels straight ahead, using a steering angle ofthe vehicle.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may detect atrajectory of the vehicle using a GPS signal and map information anddetermine whether the vehicle travels straight ahead, using the detectedtrajectory.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may determinewhether a lane is a straight lane.

In the determining whether a predetermined compensation condition issatisfied, the compensation condition determination unit may determinewhether the lane is the straight lane, using a curvature of the lane anda heading angle of the camera.

In the compensating for the heading angle of the camera, the headingangle processing unit may detect a heading angle offset using theheading angle of the camera and the lane distance therefrom andcompensate for the heading angle of the camera by subtracting thedetected heading angle offset from the heading angle of the camera.

In the compensating for the heading angle of the camera, the headingangle processing unit may calculate a reference heading angle from theheading angle of the camera using the lane distance, detect differencevalues between the calculated reference heading angle and the headingangle of the camera in chronological order, and then detect the headingangle offset by averaging the detected difference values for each timezone.

As apparent from the above description, the apparatus and method forcompensating for a heading angle according to the exemplary embodimentsof the present invention can improve the deviation of the vehicle in thelane keeping assistance system by compensating for the heading angle ofthe camera through the lane distance to assist the lane keeping of thevehicle.

In addition, the apparatus and method for compensating for a headingangle according to the exemplary embodiments of the present inventioncan assist the lane keeping of the vehicle without performing cameracorrection operations such as after service (AS) and AutoFix when thevehicle is leaned by the lane keeping assistance system.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an apparatus for compensating fora heading angle according to an embodiment of the present invention.

FIG. 2 is a conceptual view illustrating an example of straight-aheaddriving determination according to an embodiment of the presentinvention.

FIG. 3 is a conceptual view illustrating another example ofstraight-ahead driving determination according to an embodiment of thepresent invention.

FIG. 4 is a conceptual view illustrating a further example ofstraight-ahead driving determination according to an embodiment of thepresent invention.

FIG. 5 is a conceptual view illustrating an example of straight lanedetermination according to an embodiment of the present invention.

FIG. 6 is a block diagram illustrating a heading angle processing unitaccording to an embodiment of the present invention.

FIG. 7 is a flowchart illustrating a method of compensating for aheading angle according to an embodiment of the present invention.

DETAILED DESCRIPTION

The invention is described more fully hereinafter with reference to theaccompanying drawings, in which embodiments of the invention are shown.This invention may, however, be embodied in many different forms andshould not be construed as limited to the embodiments set forth herein.Rather, these embodiments are provided so that this disclosure isthorough, and will fully convey the scope of the invention to thoseskilled in the art. Like reference numerals in the drawings denote likeelements.

Various advantages and features of the present invention and methodsaccomplishing thereof will become apparent from the followingdescription of embodiments with reference to the accompanying drawings.However, the present invention is not be limited to the embodiments setforth herein but may be implemented in many different forms. The presentembodiments may be provided so that the disclosure of the presentinvention will be complete, and will fully convey the scope of theinvention to those skilled in the art and therefore the presentinvention will be defined within the scope of claims. Like referencenumerals throughout the description denote like elements.

Unless defined otherwise, it is to be understood that all the terms(including technical and scientific terms) used in the specification hasthe same meaning as those that are understood by those who skilled inthe art. Further, the terms defined by the dictionary generally usedshould not be ideally or excessively formally defined unless clearlydefined specifically. It will be understood that for purposes of thisdisclosure, “at least one of X, Y, and Z” can be construed as X only, Yonly, Z only, or any combination of two or more items X, Y, and Z (e.g.,XYZ, XYY, YZ, ZZ). Unless particularly described to the contrary, theterm “comprise”, “configure”, “have”, or the like, which are describedherein, will be understood to imply the inclusion of the statedcomponents, and therefore should be construed as including othercomponents, and not the exclusion of any other elements.

Unless otherwise defined, all terms (including technical and scientificterms) used herein have the same meaning as commonly understood by oneof ordinary skill in the art to which this disclosure is a part. Terms,such as those defined in commonly used dictionaries, should beinterpreted as having a meaning that is consistent with their meaning inthe context of the relevant art and will not be interpreted in anidealized or overly formal sense, unless expressly so defined herein.

As is traditional in the corresponding field, some exemplary embodimentsmay be illustrated in the drawings in terms of functional blocks, units,and/or modules. Those of ordinary skill in the art will appreciate thatthese block, units, and/or modules are physically implemented byelectronic (or optical) circuits such as logic circuits, discretecomponents, processors, hard-wired circuits, memory elements, wiringconnections, and the like. When the blocks, units, and/or modules areimplemented by processors or similar hardware, they may be programmedand controlled using software (e.g., code) to perform various functionsdiscussed herein. Alternatively, each block, unit, and/or module may beimplemented by dedicated hardware or as a combination of dedicatedhardware to perform some functions and a processor (e.g., one or moreprogrammed processors and associated circuitry) to perform otherfunctions. Each block, unit, and/or module of some exemplary embodimentsmay be physically separated into two or more interacting and discreteblocks, units, and/or modules without departing from the scope of theinventive concept. Further, blocks, units, and/or module of someexemplary embodiments may be physically combined into more complexblocks, units, and/or modules without departing from the scope of theinventive concept.

Hereinafter, an apparatus and method for compensating for a headingangle according to exemplary embodiments of the present invention willbe described below in detail with reference to the accompanying drawingsthrough various examples of embodiments. It should be noted that thedrawings are not necessarily to scale and may be exaggerated inthickness of lines or sizes of components for clarity and convenience ofdescription. Furthermore, the terms as used herein are terms defined inconsideration of functions of the invention and may change depending onthe intention or practice of a user or an operator. Therefore, theseterms should be defined based on the overall disclosures set forthherein.

FIG. 1 is a block diagram illustrating an apparatus for compensating fora heading angle according to an embodiment of the present invention.FIG. 2 is a conceptual view illustrating an example of straight-aheaddriving determination according to an embodiment of the presentinvention. FIG. 3 is a conceptual view illustrating another example ofstraight-ahead driving determination according to an embodiment of thepresent invention. FIG. 4 is a conceptual view illustrating a furtherexample of straight-ahead driving determination according to anembodiment of the present invention. FIG. 5 is a conceptual viewillustrating an example of straight lane determination according to anembodiment of the present invention. FIG. 6 is a block diagramillustrating a heading angle processing unit according to an embodimentof the present invention.

Referring to FIG. 1 , the apparatus for compensating for a heading angleaccording to the embodiment of the present invention includes a camera10, a compensation condition determination unit 20, and a heading angleprocessing unit 30.

The camera 10 captures the front of a vehicle to generate a forwardimage, and acquires camera information for compensating for a headingangle of the camera 10 from the generated forward image. Here, amulti-function camera (MFC) may be adopted as the camera 10 foracquiring the forward image and the camera information.

The camera information acquired by the camera 10 may include a headingangle of the camera, a lane curvature, a reliability of the camera 10, aviewing area, a lane type, and a lane width variation.

The heading angle refers to an angle between a vehicle travelingdirection and a lane progress direction from the offset of a vanishingpoint and an image center point. The heading angle may be detected bycomparing the position of the vanishing point with the position of theimage center point. That is, the heading angle of the vehicle is zero(0) when the vanishing point of both lanes on the driving road coincideswith the center point of the image captured by the camera.

The lane curvature is forward curvature information obtained using theinformation of both lanes on the road ahead.

The viewing area is a forward distance obtained from the image throughthe camera 10.

The camera reliability is reliability information about the curvatureinput from the camera 10. For example, the camera reliability may beexpressed as high, medium, and low, or a numerical value, in which casethe camera reliability may be used to compensate for the heading anglewhen it is high or medium, or is a numerical value of 2.

The lane type is information on whether the lane is a double lane, adotted lane, a solid lane, or the like. In this case, although not thelane, information about the end or guard rail of the road or the unknownmay be included in the lane. The information about the end or guard railof the road or the unknown may be used as one of the lane types.

The lane width is a distance between left and right lanes. For example,when the distance from the camera to the left lane is 2 m and thedistance from the camera to the right lane is 2.5 m, the lane width is4.5 m. The lane width variation is a variation in the lane width.

The compensation condition determination unit 20 determines whether apredetermined compensation condition is satisfied, to compensate for theheading angle of the camera 10.

In other words, the compensation condition determination unit 20collects information for compensating for the heading angle, and usesthe collected information to determine whether the vehicle travelsstraight ahead or whether the lane is a straight lane under thecompensation condition. In this case, the compensation conditiondetermination unit 20 determines that the compensation condition issatisfied when the vehicle travels straight ahead or the lane is thestraight lane.

Referring to FIG. 2 , the compensation condition determination unit 20determines whether the vehicle travels straight ahead, using a yaw rate,a vehicle speed, a curvature, a viewing area, a camera reliability, alane type, and a lane width variation.

The yaw rate is a variation in the rate of the yaw angle which is anangle of rotation around a vertical line through the center of thevehicle, and the vehicle speed is a speed of the vehicle.

Since the yaw rate and the vehicle speed are able to be easily embodiedby those skilled in the art, a detailed description thereof will beomitted herein.

The compensation condition determination unit 20 determines that thevehicle travels straight ahead, when the yaw rate is equal to or greaterthan a set yaw rate value, the vehicle speed is equal to or greater thana set vehicle speed value of 50 KPH, the curvature is equal to orgreater than a set curvature value, the viewing area is equal to orgreater than a set viewing area value, the camera reliability is 2 ormore, the lane type is recognized as a lane, or the lane width variationis equal to or greater than a set lane width variation value.

For example, the yaw rate value may be set as 0.0052 Rad, the vehiclespeed may be set as 50 KPH, the curvature may be set as 0.00012 Rad, theviewing area may be set as 30 m, the camera reliability may be set as 2,and the lane type may not be decided or may be set as a road edge or abarrier.

In addition, as illustrated in FIG. 3 , the compensation conditiondetermination unit 20 may also determine whether the vehicle travelsstraight ahead, using a global positioning system (GPS) signal or mapinformation.

The GPS signal includes position information of the vehicle, and may beobtained through a navigation system or the like provided in thevehicle.

In this case, the compensation condition determination unit 20 collectsa GPS signal to detect a driving trajectory of the vehicle and matchesthe detected driving trajectory to the map information, therebydetermining whether the vehicle travels straight ahead, through thedriving trajectory of the vehicle.

Furthermore, as illustrated in FIG. 4 , the compensation conditiondetermination unit 20 may also determine whether the vehicle travelsstraight ahead, using a steering angle of a steering wheel.

The steering angle of the steering wheel is an angle at which thedriver's steering wheel rotates to the left or right, and may beobtained through a motor-driven power steering (MDPS) system, a steeringangle sensor, or the like.

In this case, the compensation condition determination unit 20determines whether the steering angle of the steering wheel is less thanor equal to a preset steering angle value, and determines that thevehicle travels straight ahead when the steering angle of the steeringwheel is less than or equal to the set steering angle value.

Meanwhile, as illustrated in FIG. 5 , the compensation conditiondetermination unit 20 determines whether the lane is a straight lane,using a lane curvature and a heading angle.

The compensation condition determination unit 20 determines that thelane is the straight lane when the curvatures of the left and rightlanes and the values derived from the curvatures of the left and rightlanes are “0” and the heading angles of the left and right lanes areequal to each other.

The lane may be modeled as Y=C₃X³+C₂X²+C₁X+C₀. Here, C₀ refers to alateral offset, C₁ refers to a heading angle, C₂ refers to a curvature,C₃ refers to a curvature derivative value, and Y refers to a lane.

That is, the left lane is modeled and the right lane is modeled, inwhich case the compensation condition determination unit 20 determinesthat the lane is the straight lane when the lane Y is “0”.

When it is determined by the compensation condition determination unit20 that the lane is the straight lane, the heading angle processing unit30 compensates for the heading angle of the camera 10 using the lanedistance input from the camera 10.

Referring to FIG. 6 , the heading angle processing unit 30 includes aheading angle offset processing unit 31 and a heading angle compensatingunit 32.

The heading angle offset processing unit 31 detects a heading angleoffset using the heading angle of the camera 10 and the lane distancetherefrom. The heading angle offset processing unit 31 includes areference heading angle calculator 311, a difference value detector 312,and a heading angle offset detector 313.

The reference heading angle calculator 311 calculates a referenceheading angle from the heading angle of the camera 10 using the lanedistance. That is, the reference heading angle calculator 311 receivesthe lane distance and the heading angle from the camera 10 andcalculates the reference heading angle using the lane distance, in orderto secure the reliability of the heading angle of the camera 10.

The difference value detector 312 detects difference values between thereference heading angle calculated by the reference heading anglecalculator 311 and the heading angle of the camera 10 in chronologicalorder.

The heading angle offset detector 313 detects a heading angle offset byaveraging the difference values detected by the difference valuedetector 312 in chronological order. That is, when the difference valuescalculated by the difference value detector 312 are input to the headingangle offset detector 313, the heading angle offset detector 313 detectsthe heading angle offset by averaging the difference values at theheading angle of the camera 10 for each time zone.

The heading angle compensating unit 32 compensates for the heading angleof the camera 10 using the heading angle of the camera 10 and theheading angle offset detected by the heading angle offset detector 313.In this case, the heading angle compensating unit 32 compensates for theheading angle of the camera 10 by subtracting the heading angle offset,detected by the heading angle offset detector 313, from the headingangle of the camera 10.

Hereinafter, a method of compensating for a heading angle according toan embodiment of the present invention will be described in detail withreference to FIG. 7 .

FIG. 7 is a flowchart illustrating the method of compensating for aheading angle according to the embodiment of the present invention.

Referring to FIG. 7 , a compensation condition determination unit 20collects information for determining a compensation condition tocompensate for a heading angle of a camera 10 (S10).

The information for determining the compensation condition may includecamera information, a yaw rate, a vehicle speed, a GPS signal, mapinformation, and a steering angle. The camera information may include aheading angle of the camera 10, a lane curvature, a viewing area, acamera reliability, a lane type, and a lane width variation.

As the information for determining the compensation condition iscollected, the compensation condition determination unit 20 determineswhether a predetermined compensation condition is satisfied, namely,whether the lane is a straight lane or the vehicle travels straightahead, in order to compensate for the heading angle of the camera 10(S20).

For example, the compensation condition determination unit 20 determinesthat the vehicle travels straight ahead, when the yaw rate is equal toor greater than a set yaw rate value, the vehicle speed is equal to orgreater than a set vehicle speed value, the curvature is equal to orgreater than a set curvature value, the viewing area is equal to orgreater than a set viewing area value, the camera reliability is high ormedium, the lane type is recognized as a lane, or the lane widthvariation is equal to or greater than a set lane width variation value.

In addition, the compensation condition determination unit 20 uses a GPSsignal to detect a driving trajectory of the vehicle, and matches thedetected driving trajectory to map information, thereby determiningwhether the vehicle travels straight ahead on the map, through thedriving trajectory of the vehicle.

Furthermore, the compensation condition determination unit 20 determineswhether a steering angle of a steering wheel is less than or equal to apreset steering angle value, and determines that the vehicle travelsstraight ahead, when the steering angle of the steering wheel is lessthan or equal to the set steering angle value.

Meanwhile, the compensation condition determination unit 20 maydetermine whether the lane is a straight lane, using the lane curvatureand the heading angle.

In this case, the compensation condition determination unit 20 modelseach of left and right lanes. The compensation condition determinationunit 20 determines that the lane is the straight lane when thecurvatures of the left and right lanes and the values derived from thecurvatures of the left and right lanes are “0” and the heading angles ofthe left and right lanes are equal to each other.

As described above, when it is determined by the compensation conditiondetermination unit 20 that the compensation condition is satisfied, areference heading angle calculator 311 calculates a reference headingangle using the lane distance (S30).

Next, a difference value detector 312 detects difference values betweenthe reference heading angle calculated by the reference heading anglecalculator 311 and the heading angle of the camera 10 in chronologicalorder. A heading angle offset detector 313 detects a heading angleoffset by averaging the difference values, detected by the differencevalue detector 312, for each time zone (S40).

As the heading angle offset is detected by the heading angle offsetdetector 313, a heading angle compensating unit 32 compensates for theheading angle of the camera 10 using the heading angle of the camera 10and the heading angle offset detected by the heading angle offsetdetector 313 (S50). In this case, the heading angle of the camera 10 iscompensated for by subtracting the heading angle offset, detected by theheading angle offset detector 313, from the heading angle of the camera10.

As described above, the apparatus and method for compensating for aheading angle according to the exemplary embodiments of the presentinvention can improve the deviation of the vehicle in the lane keepingassistance system by compensating for the heading angle of the camerathrough the lane distance to assist the lane keeping of the vehicle.

In addition, the apparatus and method for compensating for a headingangle according to the exemplary embodiments of the present inventioncan assist the lane keeping of the vehicle without performing cameracorrection operations such as after service (AS) and AutoFix when thevehicle is leaned by the lane keeping assistance system.

While various embodiments have been described above, it will beunderstood by those skilled in the art that the embodiments describedare by way of example only. It will be apparent to those skilled in theart that various modifications and other equivalent embodiments may bemade without departing from the spirit and scope of the disclosure.Accordingly, the true technical protection scope of the invention shouldbe defined by the appended claims.

What is claimed is:
 1. An apparatus for compensating for a headingangle, comprising: a camera; and one or more processors configured todetermine whether a predetermined compensation condition is satisfied,to compensate for a heading angle of the camera; and compensate for theheading angle of the camera using a lane distance input from the camerawhen it is determined that the compensation condition is satisfied,wherein the one or more processors calculate a reference heading anglebased on the lane distance and the heading angle of the camera, andcalculate a heading angle offset based on a difference value between thereference heading angle and the heading angle of the camera.
 2. Theapparatus according to claim 1, wherein the one or more processors arefurther configured to, when compensating for the heading angle of thecamera, determine whether a vehicle travels straight ahead, or whether alane is a straight lane.
 3. The apparatus according to claim 2, wherein,when compensating for the heading angle of the camera, the one or moreprocessors are further configured to determine whether the vehicletravels straight ahead, using at least one of a vehicle yaw rate, avehicle speed, a lane curvature, a camera viewing area, a camerareliability, a lane type, and a lane width variation.
 4. The apparatusaccording to claim 2, wherein, when compensating for the heading angleof the camera, the one or more processors are further configured todetermine whether the vehicle travels straight ahead, using a steeringangle of the vehicle.
 5. The apparatus according to claim 2, wherein,when compensating for the heading angle of the camera, the one or moreprocessors are further configured to detect a trajectory of the vehicleusing a global positioning system (GPS) signal and map information anddetermine whether the vehicle travels straight ahead, using the detectedtrajectory.
 6. The apparatus according to claim 2, wherein, whencompensating for the heading angle of the camera, the one or moreprocessors are further configured to determine whether the lane is thestraight lane, using a curvature of the lane and a heading angle of thecamera.
 7. The apparatus according to claim 1, wherein, whencompensating for the heading angle of the camera, the one or moreprocessors are configured to: calculate difference values between thereference heading angle and the heading angle of the camera inchronological order; and calculate the heading angle offset by averagingthe difference values, calculated by the difference value detector, foreach time zone.
 8. The apparatus according to claim 1, wherein the oneor more processors are further configured to compensate for the headingangle of the camera by subtracting the heading angle offset from theheading angle of the camera.
 9. An apparatus for compensating for aheading angle, comprising: a camera; and one or more processorsconfigured to calculate a heading angle offset using a heading angle ofthe camera and a lane distance therefrom; and compensate for the headingangle of the camera using the heading angle of the camera and theheading angle offset, wherein the one or more processors calculate areference heading angle based on the lane distance and the heading angleof the camera, and calculate the heading angle offset based on adifference value between the reference heading angle and the headingangle of the camera.
 10. The apparatus according to claim 9, wherein theone or more processors are further configured to compensate for theheading angle of the camera by subtracting the heading angle offset fromthe heading angle of the camera.
 11. The apparatus according to claim 9,wherein, when compensating for the heading angle of the camera, the oneor more processors are configured to: calculate difference valuesbetween the reference heading angle and the heading angle of the camerain chronological order; and calculate the heading angle offset byaveraging the difference values for each time zone.
 12. A method ofcompensating for a heading angle, comprising: determining whether apredetermined compensation condition is satisfied, to compensate for aheading angle of a camera; and compensating for the heading angle of thecamera using a lane distance input from the camera, when it isdetermined by that the compensation condition is satisfied, whereincompensating for the heading angle comprises calculating a referenceheading angle based on the lane distance and the heading angle of thecamera, and calculating a heading angle offset based on a differencevalue between the reference heading angle and the heading angle of thecamera.
 13. The method according to claim 12, wherein determiningwhether a predetermined compensation condition is satisfied furthercomprises determining whether a vehicle travels straight ahead, ordetermining whether a lane is a straight lane.
 14. The method accordingto claim 13, wherein determining whether a predetermined compensationcondition is satisfied further comprises determining whether the vehicletravels straight ahead, using at least one of a vehicle yaw rate, avehicle speed, a lane curvature, a camera viewing area, a camerareliability, a lane type, and a lane width variation.
 15. The methodaccording to claim 13, wherein determining whether a predeterminedcompensation condition is satisfied further comprises determiningwhether the vehicle travels straight ahead, using a steering angle ofthe vehicle.
 16. The method according to claim 13, wherein determiningwhether a predetermined compensation condition is satisfied furthercomprises detecting a trajectory of the vehicle using a GPS signal andmap information and determines whether the vehicle travels straightahead, using the detected trajectory.
 17. The method according to claim13, wherein determining whether a predetermined compensation conditionis satisfied further comprises determining whether the lane is thestraight lane, using a curvature of the lane and a heading angle of thecamera.
 18. The method according to claim 12, wherein compensating forthe heading angle of the camera further comprises calculating differencevalues between the reference heading angle and the heading angle of thecamera in chronological order, and calculating the heading angle offsetby averaging the difference values for each time zone.
 19. The methodaccording to claim 18, wherein compensating for the heading angle of thecamera further comprises compensating for the heading angle of thecamera by subtracting the heading angle offset from the heading angle ofthe camera.